package com.example.backetballgame.gui;

import javax.swing.*;
import java.awt.*;

public class GameResultPage extends JFrame {
    private JLabel winLabel, drawLabel, loseLabel, rewardLabel, pointLabel;
    private JButton rematchButton;

    public GameResultPage(int win, int draw, int lose, int reward, int point) {
        // Set window title
        setTitle("Game Result");

        // Set window size
        setSize(600, 400);

        // Set window layout
        setLayout(new BorderLayout());

        // Create user information panel
        JPanel userInfoPanel = new JPanel();
        userInfoPanel.setLayout(new GridLayout(1, 6));

        // Create user information labels
        winLabel = new JLabel("Wins: " + win);
        drawLabel = new JLabel("Draws: " + draw);
        loseLabel = new JLabel("Losses: " + lose);
        rewardLabel = new JLabel("Rewards: " + reward);
        pointLabel = new JLabel("Points: " + point);
        pointLabel = new JLabel("Points: " + point);

        // Add user information labels to the panel
        userInfoPanel.add(winLabel);
        userInfoPanel.add(drawLabel);
        userInfoPanel.add(loseLabel);
        userInfoPanel.add(rewardLabel);
        userInfoPanel.add(pointLabel);

        // Add the user information panel to the top of the window
        add(userInfoPanel, BorderLayout.NORTH);

        // Create button panel
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BorderLayout());

        // Create buttons
        rematchButton = new JButton("Rematch");


        // Add buttons to the panel
        buttonPanel.add(rematchButton,BorderLayout.EAST);


        // Add the button panel to the bottom of the window
        add(buttonPanel, BorderLayout.SOUTH);

        // Set window visibility
        setVisible(true);
    }

    public static void main(String[] args) {
        new GameResultPage(5, 2, 3, 100, 50);
    }
}
